﻿
Public Class frm_choose_instant_video

    Public Property VideoList As New List(Of LoaderExtensions.OLV_Item)
    Public Property SelectedVideo As String = String.Empty

    Private Sub frm_choose_instant_video_Load(sender As Object, e As EventArgs) Handles MyBase.Load

        list_instantvideo.Items.Clear()

        For Each _item In VideoList

            Dim _lv_item As New ListViewItem

            _lv_item.Tag = _item
            _lv_item.Text = GetSFDLDescriptionByKey(_item.SFDLSessionName)

            list_instantvideo.Items.Add(_lv_item)

        Next

    End Sub

    Private Sub Button1_Click(sender As Object, e As EventArgs) Handles cmd_play.Click

        Dim _exec_vlc As String = String.Empty
        Dim _olv_item As New LoaderExtensions.OLV_Item

        _olv_item = TryCast(list_instantvideo.SelectedItems(0).Tag, LoaderExtensions.OLV_Item)

        _exec_vlc = String.Format("{0} {1} --no-qt-error-dialogs", GetVLCExecutable, GetDownloadFilePath(_settings, GetSFDLSessionByKey(_olv_item.SFDLSessionName), _olv_item))

        Shell(_exec_vlc, AppWinStyle.NormalFocus, False)

        Me.Close()


    End Sub
End Class